<div class="content">
<%=render :partial=>"breadcrumb"%>
<br/>


<div class="edit_photo_img">
    <h2><%= _('Edit photo') %></h2>
    <% image = image_tag(@photo.to_url(:medium), :id=>"photo_#{@photo.id}", :title=>@photo.title) %>
    <%=image -%>
    <br>
    <br>
    <h2><%= link_to _("Set as album representer"), :controller => "admin", :action => 'change_album_representer',:id =>@album.id, :num=>params[:num] %></h2>
</div>

<div class="edit_photo">
    <%= start_form_tag :action => 'update', :id => @photo  %>

        <div class="form_cover">
            <span class="form_left"><label><%= _('Title') %></label></span>
            <span class="form_right"><%= text_field "photo", "title"%></span>
        </div>              
        <div class="form_cover">
            <span class="form_left"><label><%= _('Description') %></label></span>
            <span class="form_right"><%= text_field "photo", "description"%></span>
        </div>
         
        <label>&nbsp;</label>
        <%= submit_tag _("Save changes") %>
        <%= 
        button_to_function "Cancel" do |page|
        page.redirect_to :controller => "admin", :action => "album_page", :id =>@album.id
        end%>
 

    <%= end_form_tag %>
<br/>
<br/>

    <%form_remote_tag :url => {:action=>:update_tags, :photo_id=>@photo.id} do %>
        <div class="form_cover">
            <span class="form_left"><label for="tags" ><%= _('Add new tags') %></label></span>
            <span class="form_right"><%= text_field_tag  :tags, @params[:tags], :size=>'30'  %></span>
            <div class="auto_complete" id="tags_auto_complete" ></div>
            <%= auto_complete_field :tags, :url=>{:action=>"autocomplete_add_new_tags"}, :tokens => ',' %>
            <%= submit_tag _('Add') %>
        </div>
    <%end%>
    <%= render(:partial => "tags")%>
        <label>&nbsp;</label>
        
    <div class="form_cover">
        <div class="form_left"><b><%= _('Click tag to delete') %><b></div>
        <div class="form_right">
            <div id="tags_to_delete">
                <%=render(:partial => "existing_tags") %>
            </div>
         </div>
     </div>

</div>
</div>